package com.example.intelligentattendancesystem.pojo;

import org.springframework.stereotype.Component;

import java.util.Objects;

/**
 * 请假信息实体类
 * @author
 * @version 1.0
 * @className LeaveMapping
 * @since 1.0
 */
@Component
public class Leave {
    private Integer id;
    private int userId;
    private String leaveStartTime;
    private String leaveEndTime;

    private String access;
    private String date ;

    public Leave(Integer id, int userId, String leaveStartTime, String leaveEndTime, String access, String date) {
        this.id = id;
        this.userId = userId;
        this.leaveStartTime = leaveStartTime;
        this.leaveEndTime = leaveEndTime;
        this.access = access;
        this.date = date;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Leave leave = (Leave) o;
        return userId == leave.userId && Objects.equals(id, leave.id) && Objects.equals(leaveStartTime, leave.leaveStartTime) && Objects.equals(leaveEndTime, leave.leaveEndTime) && Objects.equals(access, leave.access) && Objects.equals(date, leave.date);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, userId, leaveStartTime, leaveEndTime, access, date);
    }

    @Override
    public String toString() {
        return "Leave{" +
                "id=" + id +
                ", userId=" + userId +
                ", leaveStartTime='" + leaveStartTime + '\'' +
                ", leaveEndTime='" + leaveEndTime + '\'' +
                ", access='" + access + '\'' +
                ", date='" + date + '\'' +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getLeaveStartTime() {
        return leaveStartTime;
    }

    public void setLeaveStartTime(String leaveStartTime) {
        this.leaveStartTime = leaveStartTime;
    }

    public String getLeaveEndTime() {
        return leaveEndTime;
    }

    public void setLeaveEndTime(String leaveEndTime) {
        this.leaveEndTime = leaveEndTime;
    }

    public String getAccess() {
        return access;
    }

    public void setAccess(String access) {
        this.access = access;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public Leave() {
    }
}
